package top.yxf.spring.context.support;

import top.yxf.spring.beans.factory.support.DefaultListableBeanFactory;
import top.yxf.spring.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @author xs.wu
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocation = getConfigLocation();
        if (null != configLocation) {
            beanDefinitionReader.loadBeanDefinitions(configLocation);
        }
    }

    protected abstract String[] getConfigLocation();
}
